package com.sptpc.demo1.repository;

import com.sptpc.demo1.model.Order;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface OrderRepository extends JpaRepository<Order,Integer> {
      /**穷举所有搜索条件不可取*/
      //通过用户名查询
      List<Order> findOrderByCustomer(String customer);
      //通过状态查询
      List<Order> findOrderByState(Integer state);
      //通过用户和状态查询
      List<Order> findOrderByCustomerAndState(String customer,Integer state);

}

